`before_filter` is called `before_action` in Rails 4+.

Akinori MUSHA 9 years ago
parent
commit
8e38c0a24c

+ 1 - 1
app/controllers/application_controller.rb

@@ -1,7 +1,7 @@
1 1
 class ApplicationController < ActionController::Base
2 2
   protect_from_forgery
3 3
 
4
-  before_filter :authenticate_user!
4
+  before_action :authenticate_user!
5 5
   before_action :configure_permitted_parameters, if: :devise_controller?
6 6
 
7 7
   helper :all

+ 1 - 1
app/controllers/events_controller.rb

@@ -1,5 +1,5 @@
1 1
 class EventsController < ApplicationController
2
-  before_filter :load_event, :except => :index
2
+  before_action :load_event, except: :index
3 3
 
4 4
   def index
5 5
     if params[:agent_id]

+ 2 - 2
app/controllers/home_controller.rb

@@ -1,7 +1,7 @@
1 1
 class HomeController < ApplicationController
2
-  skip_before_filter :authenticate_user!
2
+  skip_before_action :authenticate_user!
3 3
 
4
-  before_filter :upgrade_warning, only: :index
4
+  before_action :upgrade_warning, only: :index
5 5
 
6 6
   def index
7 7
   end

+ 1 - 1
app/controllers/jobs_controller.rb

@@ -1,5 +1,5 @@
1 1
 class JobsController < ApplicationController
2
-  before_filter :authenticate_admin!
2
+  before_action :authenticate_admin!
3 3
 
4 4
   def index
5 5
     @jobs = Delayed::Job.order("coalesce(failed_at,'1000-01-01'), run_at asc").page(params[:page])

+ 1 - 1
app/controllers/logs_controller.rb

@@ -1,5 +1,5 @@
1 1
 class LogsController < ApplicationController
2
-  before_filter :load_agent
2
+  before_action :load_agent
3 3
 
4 4
   def index
5 5
     @logs = @agent.logs.all

+ 1 - 1
app/controllers/scenarios_controller.rb

@@ -1,6 +1,6 @@
1 1
 class ScenariosController < ApplicationController
2 2
   include SortableTable
3
-  skip_before_filter :authenticate_user!, :only => :export
3
+  skip_before_action :authenticate_user!, only: :export
4 4
 
5 5
   def index
6 6
     set_table_sort sorts: %w[name public], default: { name: :asc }

+ 1 - 1
app/controllers/services_controller.rb

@@ -1,7 +1,7 @@
1 1
 class ServicesController < ApplicationController
2 2
   include SortableTable
3 3
 
4
-  before_filter :upgrade_warning, only: :index
4
+  before_action :upgrade_warning, only: :index
5 5
 
6 6
   def index
7 7
     set_table_sort sorts: %w[provider name global], default: { provider: :asc }

+ 1 - 1
app/controllers/web_requests_controller.rb

@@ -16,8 +16,8 @@
16 16
 #   ["not found", 404, 'text/plain']
17 17
 
18 18
 class WebRequestsController < ApplicationController
19
-  skip_before_filter :authenticate_user!
20 19
   skip_before_action :verify_authenticity_token
20
+  skip_before_action :authenticate_user!
21 21
 
22 22
   def handle_request
23 23
     user = User.find_by_id(params[:user_id])